package io.demo4_缓冲;

import java.io.*;

public class Test {
    public static void read(String[] args) throws Exception{
        FileInputStream fis=new FileInputStream("d:/1.txt");
//        fis.read();
//        byte[]arr=new byte[16];
//        fis.read(arr);
        BufferedInputStream bi=new BufferedInputStream(fis);
        bi.read();
        bi.read();
    }

    public static void main(String[] args)throws Exception {
        OutputStream os=new FileOutputStream("d:/1.txt");
        BufferedOutputStream bos=new BufferedOutputStream(os);

        for(int i=0;i<10000;i++){
            bos.write(i);
        }
        bos.flush();//本输出流还可以继续使用
        bos.close();
    }

}
